//
// Created by wkm on 2023-12-05.
//

#ifndef MYSYSTEMCLEARNING_MOD_COUNTER_H
#define MYSYSTEMCLEARNING_MOD_COUNTER_H

#include "systemc.h"

const int NBITS = 4;
const int UPTO = 11;

SC_MODULE(mod_counter) {
    sc_in<bool> clk, clear;
    sc_out<sc_uint<NBITS> > q, qbar;

    sc_signal<sc_uint<NBITS> > counter;

    void prc_counter();

    void prc_outputs();

    SC_CTOR(mod_counter) {
        SC_METHOD(prc_counter);
        sensitive_pos << clk << clear;

        SC_METHOD(prc_outputs);
        sensitive << counter;
    }
};

#endif //MYSYSTEMCLEARNING_MOD_COUNTER_H
